package com.woniuxy.driverschool.service.impl;

import com.woniuxy.driverschool.entity.Report;
import com.woniuxy.driverschool.entity.Student;
import com.woniuxy.driverschool.entity.StudyTime;
import com.woniuxy.driverschool.mapper.ReportMapper;
import com.woniuxy.driverschool.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author: xyq
 * @version: 1.0.0
 * @create: 2021/9/29 11:21
 * @description: TODO
 */
@Service
public class ReportServiceImpl implements ReportService {

    @Autowired
    ReportMapper reportMapper;

    //增添学员审查报告
    @Override
    public void addReport(Report report){
        reportMapper.addReport(report);
    }

    //删除学员审查报告
    @Override
    public void removeReport(int rid) {
        reportMapper.removeReport(rid);
    }

    //修改学员审查报告
    @Override
    public void updateReport(String reportStauts, Date reportTime,String reportSubject, String student, String studyTime, int rid) {
        reportMapper.updateReport(reportStauts,reportTime,reportSubject,student,studyTime,rid);
    }

    //通过id查询学员审查报告
    @Override
    public Report selectReportByRid(int rid) {
        return reportMapper.selectReportByRid(rid);
    }

    //分页查询学员审查报告
    @Override
    public List<Report> selectAllReportsByPage(Report report, Integer pageIndex, Integer pageSize, Date startTime, Date endTime) {
        return reportMapper.selectAllReportsByPage(report, pageIndex, pageSize,startTime,endTime);
    }

    //学员审查报告总条数
    @Override
    public int selectCountReportsByPage(Report report, Date startTime, Date endTime) {
        return reportMapper.selectCountReportsByPage(report,startTime,endTime);
    }
}